#include "StdAfx.h"
#include "Bird.h"
#include <iostream>
using namespace std;

CBird::CBird()
{
	m_flyStrategy = 0;
}

CBird::~CBird()
{
	if ( m_flyStrategy != 0 )
	{
		delete m_flyStrategy;
	}
}

void CBird::fly()
{
	m_flyStrategy->fly();
}

void CBird::right()
{
	m_flyStrategy->right();
}

void CBird::setFlyStrategy(IFlyStrategy * flyStrategy)
{
	m_flyStrategy = flyStrategy;
}

const IFlyStrategy * CBird::getFlyStrategy() const
{
	return m_flyStrategy;
}